package com.rdgk.newtech.controller;

import com.alibaba.fastjson.JSONObject;
import com.rdgk.newtech.service.ArticleService;
import com.rdgk.newtech.service.ParametersService;
import com.rdgk.newtech.service.ProjectService;
import com.rdgk.newtech.util.CommonUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.slf4j.Logger;
import org.apache.shiro.session.Session;
import org.apache.shiro.SecurityUtils;
import org.slf4j.LoggerFactory;
import com.rdgk.newtech.util.constants.Constants;
import com.rdgk.newtech.service.LogManagementService;
import javax.servlet.http.HttpServletRequest;
/**
 * @author: zandaoguang
 * @description: 文章相关Controller
 */
@RestController
@RequestMapping("/logmanagement")
public class LogManagementController {

    @Autowired
    private ArticleService articleService;
    @Autowired
    private LogManagementService logmanagementService;
    @Autowired
    private ProjectService projectService;
    /**
     * 查询文章列表
     */
    @RequiresPermissions("article:list")
    @GetMapping("/listlog")
    public JSONObject listlog(HttpServletRequest request) {
        return logmanagementService.listlog(CommonUtil.request2Json(request));
    }

    @RequiresPermissions("article:delete")
    @PostMapping("/deletelog")
    public JSONObject deletelog(@RequestBody JSONObject requestJson) {
        System.out.println("requestJson:"+requestJson);
        return logmanagementService.deletelog(requestJson);
    }
    /**
     * 搜索文章列表
     */
    @RequiresPermissions("article:list")
    @GetMapping("/listlogbysearch")
    public JSONObject listlogbysearch(HttpServletRequest request) {
        return logmanagementService.listlogbysearch(CommonUtil.request2Json(request));
    }








}
